<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<h1 style="text-align: center"><bean:message key="notification.title"/></h1>
<html:errors/>
<c:choose>
    <c:when test="${empty notificaciones}">
        <p style="text-align: center"><bean:message key="list.nonotifications"/></p>
    </c:when>
    <c:otherwise>
        <table border="0" style="margin: auto">
            <%--<tr>
                <th><bean:message key="list.sender"/></th>
                <th><bean:message key="list.subject"/></th>
                <th><bean:message key="list.date"/></th>
            </tr>--%>
            <tr>
                <td><a href="novaaningunlao" onMouseOver="document.getElementById('amigos').style.visibility = 'visible'" onMouseOut="document.getElementById('amigos').style.visibility = 'hidden'">
                        <div>
                            <c:choose>
                                <c:when test="${contador[0] == 0}">
                                    <img src="./CSS/general/images/sinamigos.gif" />
                                </c:when>
                                <c:otherwise>
                                    <img src="./CSS/general/images/conamigos.gif" />
                                </c:otherwise>
                            </c:choose>
                        </div></a></td>
                <td><a href="novaaningunlao" onMouseOver="document.getElementById('mensajes').style.visibility = 'visible'" onMouseOut="document.getElementById('mensajes').style.visibility = 'hidden'">
                        <div>
                            <c:choose>
                                <c:when test="${contador[1] == 0}">
                                    <img src="./CSS/general/images/sincorreo.gif" />
                                </c:when>
                                <c:otherwise>
                                    <img src="./CSS/general/images/concorreo.gif" />
                                </c:otherwise>
                            </c:choose>
                        </div></a></td>
                <td><a href="novaaningunlao" onMouseOver="document.getElementById('ejercicios').style.visibility = 'visible'" onMouseOut="document.getElementById('ejercicios').style.visibility = 'hidden'">
                        <div>
                            <c:choose>
                                <c:when test="${contador[2] == 0}">
                                    <img src="./CSS/general/images/sinejercicio.gif" />
                                </c:when>
                                <c:otherwise>
                                    <img src="./CSS/general/images/conejercicio.gif" />
                                </c:otherwise>
                            </c:choose>
                        </div></a></td>
            </tr>
        </table>
        <logic:present name="notificaciones">
            <div id="amigos" style="visibility: hidden">
                <logic:iterate id="lista" name="notificaciones">
                    <c:choose>
                        <c:when test="${lista.tipos.idtipo < 3}">
                            <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/>
                            <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                        </c:when>
                    </c:choose>
                </logic:iterate>
            </div>
        </logic:present>
        <logic:present name="notificaciones">
            <div id="mensajes" style="visibility: hidden">
                <logic:iterate id="lista" name="notificaciones">
                    <c:choose>
                        <c:when test="${lista.tipos.idtipo == 3}">
                            <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/>
                            <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                        </c:when>
                    </c:choose>
                </logic:iterate>
            </div>
        </logic:present>
        <logic:present name="notificaciones">
            <div id="ejercicios" style="visibility: hidden">
                <logic:iterate id="lista" name="notificaciones">
                    <c:choose>
                        <c:when test="${lista.tipos.idtipo > 5}">
                            <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/>
                            <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                        </c:when>
                    </c:choose>
                </logic:iterate>
            </div>
        </logic:present>
    </c:otherwise>              
</c:choose>